<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.min.js"></script>
    <title>Document</title>
    <style>
        @page {
            margin: 0;
        }
        .center {
           text-align: center;
        }
        .title {
          font-weight: bold;
          font-size: 24px;
        }
        #app{
          width: 8cm;
          height: 16cm;
          margin-left: 1cm;
        }

    </style>
</head>

<body>
    <div id='app'>
      <div class="center title">取药单</div>
       <table border = "1px" cellspacing = "0px">
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
         <tr>
           <td>序号</td>
           <td>测试</td>
           <td>测试2</td>
         </tr>
       </table>
    </div>
</body>
<script>
    //引入ipcRenderer对象
    const { ipcRenderer } = require('electron')
    new Vue({
        el: "#app",
        data: {
          printData: {
              hzxm:'',
              address:'',
              phone:'',
            },

        },
        mounted() {
            ipcRenderer.on('webview-print-render', (e, data) => { //接收响应
                // console.log(e)
                this.printData = data;
                ipcRenderer.sendToHost('webview-print-do') //向webview所在页面的进程传达消息
            })
        },
        methods: {}
    })
</script>

</html>
